/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: GaoBo
 * Date: 2021-05-23
 * Time: 14:11
 */
class Animal {
    public String name;
    public Animal(String name) {
        this.name = name;
    }
}

public class Test extends Animal{
    public Test(String name) {
        super(name);
    }
    public static void main(String[] args) {
        String str1 = "hello";
        String str2 = new String("hello");
        System.out.println(str1 == str2);

        String str3 = "he"+"llo";//编译的时候这个地方相当于 String str3 = "hello";
        System.out.println(str1 == str3);

        String str4 = "he";
        String str5 = "llo";
        String str6 = str4+str5;
        System.out.println(str1 == str6);

        String str7 = "he"+new String("llo");
        System.out.println(str1 == str7);
    }
}
